package com.cristina.attention.utils;

/**
 * @Author superman
 * @Date 2021/11/30 9:18
 **/
public class CoreUtils {

    public static String assemble(String ...assemble) {
        StringBuffer strBuffer = new StringBuffer(16);
        for (String target : assemble) {
            strBuffer.append(target);
        }
        return strBuffer.toString();
    }

    /**
     * 自定义编码
     * @param code
     * @param randomLength
     * @return 编码
     */
    public static String buildCustomBusinessCode(String code, int randomLength) {
        return "";
    }

    /**
     * 自定义 id编码
     * @return id
     */
    public static int buildCacheKeyBusinessCode(String cacheKey) {
        RedisUtils redisUtils = SpringContextHolder.getBean(RedisUtils.class);
        return redisUtils.customIncr(cacheKey);
    }

}
